package com.app.net.manager.account;

import com.app.net.common.AbstractBaseManager;
import com.app.net.common.RequestResultListener;
import com.app.net.res.Main;
import com.app.net.res.ResultObject;
import com.retrofits.net.common.RequestBack;

import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;

/**
 * Created by Administrator on 2016/9/7.
 */
public class MainManager extends AbstractBaseManager {


    public MainManager(RequestBack requestBack) {
        super(requestBack);
    }

    @Override
    protected void init() {

    }

    @Override
    protected void request(Retrofit retrofit, String other) {
        ApiAccount service = retrofit.create(ApiAccount.class);
        Call<ResultObject<Main>> call = service.main();
        call.enqueue(new RequestResultListener<ResultObject<Main>>(this) {
            @Override
            public Object getObject(Response<ResultObject<Main>> response) {
                ResultObject<Main> body = response.body();
                Main obj = body.AppConfig;
                return obj;
            }
        });
    }

}
